<extend name="./Common/View/Public/list.html" />

<block name="page_title">学生列表</block>
<block name="search">
    <div class="layui-input-inline">
        <select name="grade" id="grade" lay-filter="grade" api="sys/Config/grade" affect="#class_id" empty="年级"></select>
    </div>
    <div class="layui-input-inline">
        <select name="depart_id" id="depart_id" lay-filter="depart_id" api="base/Department/slist/status/1/type/3" affect="#class_id" empty="所在专业"></select>
    </div>
    <div class="layui-input-inline">
        <select name="class_id" id="class_id" lay-filter="class_id" api="base/Class/slist" depend="#grade,#depart_id" empty="班级"></select>
    </div>
    <div class="layui-input-inline">
        <input class="layui-input" name="keywords" autocomplete="off" placeholder="姓名" />
    </div>
</block>
<block name="toolbar">
    {:W('Todo/UI/toolbar',array('学生',array('add','delete','enable','disable','imports','exports')))}
</block>
<block name="main">
    <script type="text/javascript">
        var list = {api:"{$Think.const.MODULE_NAME}/{$Think.const.CONTROLLER_NAME}/"};
        list.columns =  [[
            {checkbox: true, fixed: true}
            , {field:'number', minWidth:100, title : '学号'}
            , {field:'name', minWidth:200, title : '姓名'}
            , {field:'class_id', minWidth:150, title : '班级', templet: '#tpl_class'}
            , {field:'email', minWidth:150, title : '邮箱'}
            , {field:'phone', minWidth:150, title : '手机'}
            , {field:'sex', minWidth:80, title : '性别',  templet: '#tpl_sex'}
            , {field: 'status', title: '状态', width: 80, sort: true, templet: '#tpl_status'}
            ,{fixed: 'right', title: '操作', width:100, align:'center', toolbar: '#tpl_bar'}
        ]];
    </script>
    <script type="text/html" id="tpl_bar">
        {{ format_optbar(['edit','delete']) }}
    </script>
    <script type="text/html" id="tpl_sex">
        {{ format_sex(d.sex) }}
    </script>
    <script type="text/html" id="tpl_class">
        {{ format_data_class(d.class_id) }}
    </script>
    <script type="text/html" id="tpl_status">
        {{ format_status(d.status) }}
    </script>
</block>
<block name="script">
    <script src="/api/Base/class/format"></script>
</block>